define(function(require, exports, module) {
    "use strict"; 
    var $ = require("$");
    require("echarts-all");
    return{
    	maps:function(id,data,setConfig){
    		var myChart = echarts.init(document.getElementById(id));
    		var legends=[];
            $(data.data).each(function(){
                legends.push(this.name);
            });
    		var option = {
                title : {
                    text: '',
                    subtext: '',
                    x:''
                },
                tooltip : {
                    trigger: 'item'
                },
                legend: {
                    orient: 'vertical',
                    x:'left',
                    data:legends
                },
                dataRange: {
                    min: data.min,
                    max: data.max,
                    x: 'right',
                    y: '80px',
                    text:['高','低'],           // 文本，默认为数值文本
                    calculable : true
                },
                toolbox: {
                    show: true,
                    orient : 'vertical',
                    x: 'right',
                    y: 'top',
                    feature : {
                        saveAsImage : {show: true}
                    }
                },
                roamController: {
                    show: true,
                    x: 'right',
                    mapTypeControl: {
                        'china': true
                    }
                },
                series : data.data
            };

            option=$.extend(true, option, setConfig);
            myChart.setOption(option);
    	}
    }
});